import request from '@/request/index.js'





export function list() {
	return request.get({
		url: "/api/index/getGoods",
	});
}
export function list1(data) {
	return request.get({
		url: "/api/index/getGoods",
		data
	});
}


export function add(data) {
	return request.post({
		url: "/api/index/addGoods",
		data: data
	});
}
export function update(data) {
	return request.post({
		url: "/api/index/editGoods",
		data: data
	});
}
export function del(data) {
	return request.delete({
		url: `/api/index/delGoods`,
		data
	});
}


export function createOrder(data) {
	return request.post({
		url: "/api/index/createOrder",
		data: data
	});
}


export function createOrder1(data) {
	return request.post({
		url: "/api/index/createProduct",
		data: data
	});
}
export function createOrderUsed(data) {
	return request.post({
		url: "/api/index/createOrderUsed",
		data: data
	});
}

export function orders() {
	return request.post({
		url: "/api/index/orderlist",
	});
}
export function orders1() {
	return request.post({
		url: "/api/index/productlist",
	});
}
export function usedlist() {
	return request.post({
		url: "/api/index/usedlist",
	});
}


export function ordersDetails(id) {
	return request.post({
		url: "/api/index/order?id=" + id,
	});
}



export function getType() {
	return request.get({
		url: "/api/index/getCate",
	});
}
export function getSpec(data) {
	return request.get({
		url: "/api/index/getSpec",
		data
	});
}
export function getProductList() {
	return request.get({
		url: "/api/index/getProduct",
	});
}
export function getProductListById(id) {
	return request.get({
		url: "/api/index/getProduct?cate_id=" + id,
	});
}


export function myCode(id) {
	return request.get({
		url: "/api/user/makeWechatCode?id=" + id,
	});
}
export function orderCode(id) {
	return request.get({
		url: "/api/user/makeOrderCode?id=" + id,
	});
}
export function refund(id) {
	return request.get({
		url: "/api/wechat/refund?order_sn=" + id,
	});
}

export function getById(id) {
	return request.get({
		url: "/api/index/orderProductInfo?id=" + id,
	});
}
export function destoryOrder(id) {
	return request.get({
		url: "/api/index/destoryOrderProduct?id=" + id,
	});
}




export function createUsed(data) {
	return request.post({
		url: "/api/index/createUsed",
		data
	});
}
export function editUsed(data) {
	return request.post({
		url: "/api/index/editUsed",
		data
	});
}
export function getUsed(data) {
	return request.get({
		url: "/api/index/getUsed",
		data
	});
}
export function delUsed(data) {
	return request.post({
		url: "/api/index/delUsed",
		data
	});
}
export function getUsedType() {
	return request.get({
		url: "/api/index/getUsedType",

	});
}